var t, a = require("../../../@babel/runtime/helpers/interopRequireDefault")(require("../../../@babel/runtime/regenerator")), e = require("../../../@babel/runtime/helpers/asyncToGenerator"), i = require("../../../@babel/runtime/helpers/objectSpread2"), r = require("../../../@babel/runtime/helpers/defineProperty"), s = getApp();

Page({
    data: {
        show_page: !1,
        is_apply: !1,
        is_identity: !1,
        search_lawyer_firm: "",
        status: "",
        lawyerId: "",
        lf_id: "",
        radio: "",
        columnsOffice: [],
        current_page: 1,
        last_page: 1,
        current_page_enterprise: 1,
        last_page_enterprise: 1,
        type: "",
        domainColumn: [],
        top_thumb_image: "",
        columns: [ "男", "女" ],
        provinceData: [],
        Practice: [],
        logo: [],
        district_id: "",
        city_id: "",
        province_id: "",
        street_id: "",
        identity_card_front: [],
        identity_card_backend: [],
        cityData: [],
        districtData: [],
        selectAddressData: [],
        streetShow: !1,
        genderShow: !1,
        isShowStreet: !1,
        enterpriseShow: !1,
        officeShow: !1,
        jobShow: !1,
        domainShow: !1,
        agremment: !1,
        pickerValue: [ 0, 0, 0 ],
        opren: !1,
        minDate: new Date(1900, 1, 1),
        maxDate: new Date(2030, 12, 31),
        currentDate: new Date().getTime(),
        agreementShow: !1,
        genderImg: {
            man: "https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/debt/manNo.png",
            women: "https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/debt/womenNo.png"
        },
        form: {
            addressName: "",
            locationTitle: "",
            name: "",
            logo: "",
            job_name: "",
            job_no: "",
            identity_card_front: "",
            identity_card_backend: "",
            Practice: "",
            mobile: "",
            province: "",
            city: "",
            district: "",
            address: "",
            isDefault: !1,
            desc: "",
            gender: "",
            domainColumn: [],
            job_time: "",
            job_year: "",
            office: "",
            point: "",
            street: "",
            detailed_address: "",
            logo_img: "",
            Practice_img: "",
            identity_card_front_img: "",
            identity_card_backend_img: ""
        },
        share: "",
        merchant_member_id: "",
        formatter: function(t, a) {
            return "year" === t ? "".concat(a, "年") : "month" === t ? "".concat(a, "月") : a;
        },
        enterpriseList: [],
        enterprise_radio: "",
        enterprise_name: ""
    },
    search_lawyer_firm: function(t) {
        var a = this;
        console.log(t), this.setData({
            search_lawyer_firm: t.detail
        }), this.timer && clearTimeout(this.timer), this.timer = setTimeout(function() {
            a.getLawyerOffice(a.data.search_lawyer_firm);
        }, 300);
    },
    goBack: function() {
        wx.navigateBack();
    },
    chooseEnterprise: function(t) {
        this.setData({
            enterprise_radio: t.currentTarget.dataset.id
        });
    },
    getEnterprise: function() {
        var t = this;
        s._getNetWork({
            url: s.getNetAddresss("plugin.lawyer-platform.frontend.controllers.lawyer-firm.verify"),
            success: function(a) {
                if (1 == a.data.result && 0 !== a.data.data.length) {
                    var e = a.data.data.business_list.data;
                    1 == e.length ? t.setData({
                        enterprise_radio: e[0].id
                    }) : t.setData({
                        enterpriseList: e,
                        last_page_enterprise: a.data.data.business_list.last_page
                    });
                }
            }
        });
    },
    EnterprisePopup: function(t) {
        var a = this;
        if (t.currentTarget.dataset.flag && this.data.enterprise_radio) {
            var e = this.data.enterpriseList.filter(function(t) {
                return t.id == a.data.enterprise_radio;
            });
            this.setData({
                enterprise_name: e[0].name
            });
        }
        this.setData({
            enterpriseShow: !1
        });
    },
    checkLawyer: function() {
        var t = this, a = "";
        a = "lawyer" == this.data.share || "lawyer" == this.data.type ? "plugin.lawyer-platform.frontend.controllers.lawyer.verify" : "plugin.lawyer-platform.frontend.controllers.lawyer-firm.verify", 
        s._getNetWork({
            url: s.getNetAddresss(a),
            success: function(a) {
                if (1 == a.data.result) if (t.data.share) wx.navigateTo({
                    url: "/packageI/lawyerPlatform/lawyerPlatform_index/index"
                }); else {
                    if (t.setData({
                        is_apply: a.data.data.is_apply,
                        is_identity: a.data.data.is_identity
                    }), a.data.data.is_apply && a.data.data.is_identity) return void wx.navigateTo({
                        url: "/packageI/lawyerPlatform/manage/manage?type=office"
                    });
                    t.setData({
                        show_page: !0
                    });
                }
            }
        });
    },
    _getLawyerDeatil: function() {
        var t = this;
        s._getNetWork({
            url: s.getNetAddresss("plugin.lawyer-platform.frontend.controllers.lawyer.getDetail"),
            success: function(a) {
                if (1 == a.data.result) {
                    var e, i = a.data.data.detail, s = t.data.columnsOffice.filter(function(t) {
                        return t.id == i.lf_id;
                    });
                    t.data.logo.push({
                        url: i.avatar_image
                    }), t.data.Practice.push({
                        url: i.number_thumb_image
                    }), t.data.identity_card_backend.push({
                        url: i.id_card_back_thumb_image
                    }), t.data.identity_card_front.push({
                        url: i.id_card_front_thumb_image
                    }), t.data.domainColumn = i.category_data, t.data.domainColumn.forEach(function(t) {
                        return t.status = !0;
                    }), t.data.form.point = {
                        lng: i.location[0],
                        lat: i.location[1]
                    };
                    var n = new Date(Number(i.start_time)), o = n.getFullYear(), d = n.getMonth() + 1, c = n.getDate();
                    d < 10 && (d = "0".concat(d)), c < 10 && (c = "0".concat(c)), t.setData({
                        "form.job_time": "".concat(o, "-").concat(d, "-").concat(c)
                    }), t.setData((e = {
                        lawyerId: i.id,
                        province_id: i.address.province,
                        city_id: i.address.city,
                        district_id: i.address.area,
                        logo: t.data.logo,
                        Practice: t.data.Practice,
                        identity_card_backend: t.data.identity_card_backend,
                        identity_card_front: t.data.identity_card_front,
                        "form.gender": 1 == i.gender ? "男" : "女",
                        "form.name": i.name,
                        "form.locationTitle": i.location_name,
                        "form.mobile": i.tel,
                        "form.job_year": i.year,
                        "form.job_name": i.title,
                        "form.job_no": i.number,
                        "form.logo_img": i.avatar,
                        "form.Practice_img": i.number_thumb,
                        "form.identity_card_backend_img": i.id_card_back_thumb,
                        "form.identity_card_front_img": i.id_card_front_thumb,
                        "form.desc": i.introduction,
                        lf_id: i.lf_id,
                        "form.office": s[0].name,
                        "form.domainColumn": t.data.domainColumn,
                        "form.addressName": i.show_address
                    }, r(e, "form.locationTitle", i.location_name), r(e, "form.point", t.data.form.point), 
                    e));
                }
            }
        });
    },
    getLawyerOffice: function() {
        var t = this, a = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "";
        s._getNetWork({
            url: s.getNetAddresss("plugin.lawyer-platform.frontend.controllers.lawyer.getLawyerFirm"),
            data: {
                name: a
            },
            success: function(a) {
                1 == a.data.result && t.setData({
                    columnsOffice: a.data.data.list.data,
                    current_page: a.data.data.list.current_page,
                    last_page: a.data.data.list.last_page
                });
            }
        });
    },
    getCtegory: function() {
        var t = this;
        s._getNetWork({
            url: s.getNetAddresss("plugin.lawyer-platform.frontend.controllers.lawyer.getCategory"),
            success: function(a) {
                1 == a.data.result && (a.data.data.category.forEach(function(t) {
                    return t.status = !1;
                }), t.setData({
                    domainColumn: a.data.data.category
                }));
            }
        });
    },
    _getDeatil: function() {
        var t = this, a = s.getNetAddresss("plugin.lawyer-platform.frontend.controllers.lawyer-firm.getDetail");
        s._postNetWork({
            url: a,
            success: function(a) {
                var e = a.data.data.detail, i = wx.getStorageSync("provinceData"), r = wx.getStorageSync("cityData"), s = wx.getStorageSync("districtData"), n = i.filter(function(t) {
                    return t.id == e.address.province;
                }), o = r.filter(function(t) {
                    return t.id == e.address.city;
                }), d = s.filter(function(t) {
                    return t.id == e.address.area;
                }), c = n[0].areaname + o[0].areaname + d[0].areaname;
                t.data.logo.push({
                    url: e.logo_image
                }), t.data.Practice.push({
                    url: e.thumb_image
                }), t.setData({
                    status: e.status,
                    officeId: e.id,
                    province_id: e.address.province,
                    city_id: e.address.city,
                    district_id: e.address.area,
                    street_id: e.address.street,
                    "form.name": e.name,
                    "form.logo_img": e.logo,
                    "form.Practice_img": e.thumb,
                    logo: t.data.logo,
                    radio: e.lf_id,
                    Practice: t.data.Practice,
                    "form.mobile": e.tel,
                    "form.desc": e.introduction,
                    "form.detailed_address": e.address_detail,
                    "form.addressName": c
                }), t._getStreet(e.address.area);
            }
        });
    },
    _getData: function() {
        var t = this, a = s.getNetAddresss("plugin.lawyer-platform.frontend.controllers.index.index");
        s._getNetWork({
            url: a,
            success: function(a) {
                if (1 == a.data.result) {
                    var e = a.data.data, i = "office" == t.data.type ? e.set.lf_top_thumb_image : e.set.l_top_thumb_image;
                    t.setData({
                        top_thumb_image: i,
                        l_content: a.data.data.set.l_content,
                        l_status: a.data.data.set.l_status
                    }), wx.setNavigationBarTitle({
                        title: e ? e.set.diy_name : "律师平台"
                    });
                }
            }
        });
    },
    onChangeStatus: function(t) {
        console.log(t), this.setData({
            status: t.detail
        });
    },
    toggleGender: function(t) {
        var a = t.currentTarget.dataset.type;
        "man" == a ? (this.data.genderImg.man = "https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/debt/manYes.png", 
        this.data.genderImg.women = "https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/debt/womenNo.png") : (this.data.genderImg.man = "https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/debt/manNo.png", 
        this.data.genderImg.women = "https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/debt/womenYes.png"), 
        this.setData({
            genderShow: !1,
            genderImg: this.data.genderImg,
            "form.gender": "man" == a ? "男" : "女"
        });
    },
    onChange: function(t) {
        this.setData({
            agremment: t.detail
        });
    },
    toGeolocation: function() {
        wx.navigateTo({
            url: "/packageC/o2o/o2oLocation_loc/o2oLocation_loc?tag=storeApply"
        });
    },
    chooseDomain: function(t) {
        var a = t.currentTarget.dataset.value.id;
        this.data.domainColumn.forEach(function(t) {
            t.id == a && (t.status = !t.status);
        }), this.setData({
            domainColumn: this.data.domainColumn
        });
    },
    openDateLwtbtn: function() {
        this.setData({
            openDateLw: !0
        });
    },
    cancelDomain: function(t) {
        var a = t.target;
        this.data.form.domainColumn.splice(a.dataset.index, 1), this.data.domainColumn.forEach(function(t) {
            t.id == a.dataset.id && (t.status = !1);
        }), this.setData({
            "form.domainColumn": this.data.form.domainColumn,
            domainColumn: this.data.domainColumn
        });
    },
    bindChange: function(t) {
        var a = t.detail.value;
        this.data.pickerValue[0] != a[0] && (a[1] = 0, a[2] = 0), this.data.pickerValue[1] != a[1] && (a[2] = 0), 
        this.setData({
            "pickerValue[0]": a[0],
            "pickerValue[1]": a[1],
            "pickerValue[2]": a[2]
        }), this._initAddressInfo();
    },
    _initAddressInfo: function() {
        var t = this;
        wx.getStorage({
            key: "provinceData",
            success: function() {
                t._getProvinceData();
            },
            fail: function(a) {
                s._getNetWork({
                    url: s.getNetAddresss("member.member-address.address"),
                    success: function(a) {
                        var e = a.data, i = e.data.province, r = e.data.city, s = e.data.district;
                        wx.setStorage({
                            key: "provinceData",
                            data: i
                        }), wx.setStorage({
                            key: "cityData",
                            data: r
                        }), wx.setStorage({
                            key: "districtData",
                            data: s
                        }), t._initAddressInfo();
                    },
                    fail: function(t) {},
                    state: !0
                });
            }
        });
    },
    addressinp: function(t) {
        var a = t.detail;
        this.setData({
            "form.detailed_address": a
        });
    },
    streetChoose: function() {
        "" == this.data.form.addressName ? wx.showToast({
            icon: "none",
            title: "请先选择所在地区",
            duration: 1500
        }) : this.setData({
            streetShow: !0,
            opren: !1
        });
    },
    _closeDateLw: function() {
        this.setData({
            openDateLw: !1
        });
    },
    _okAddress: function() {
        var t = this.data.selectAddressData;
        this.setData({
            "form.street": "",
            districtVal: "",
            district_id: t[2].id,
            city_id: t[1].id,
            province_id: t[0].id,
            "form.addressName": t[0].name + " " + t[1].name + " " + t[2].name,
            "form.province": t[0].name,
            "form.city": t[1].name,
            "form.district": t[2].name
        }), this._getStreet(t[2].id), this._closeDateLw();
    },
    afterRead: function(t) {
        var a = this;
        wx.showLoading({
            title: "上传中"
        });
        var e = t.detail.file, n = s.getNetAddresss("upload.uploadPic"), o = t.currentTarget.dataset.type;
        wx.uploadFile({
            url: n,
            filePath: e.url,
            name: "file",
            success: function(t) {
                var n;
                s.tips("上传成功");
                var d = JSON.parse(t.data);
                a.data[o].push(i(i({}, e), {}, {
                    url: d.data.img_url,
                    status: "done",
                    message: "上传完成"
                }));
                var c = "form.".concat(o), l = "";
                l = "logo" == o ? "logo_img" : "Practice" == o ? "Practice_img" : "identity_card_front" == o ? "identity_card_front_img" : "identity_card_backend_img", 
                a.setData((r(n = {}, o, a.data[o]), r(n, c, d.data.img_url), r(n, "form.".concat(l), d.data.img), 
                n));
            },
            fail: function(t) {
                s.tips("上传成功");
                var a = [];
                a.push(i(i({}, e), {}, {
                    url: "",
                    status: "failed",
                    message: "上传失败"
                })), this.setData({
                    fileList: a
                });
            },
            complete: function() {
                wx.hideLoading();
            }
        });
    },
    delete: function(t) {
        var a = t.currentTarget.dataset.type;
        this.setData(r({}, a, []));
    },
    _getStreet: function(t) {
        var a = this, e = this, i = s.getNetAddresss("member.memberAddress.street");
        i += "&district_id=" + t, s._getNetWork({
            url: i,
            success: function(t) {
                var i = t.data;
                1 != i.result || s._isTextEmpty(i.data) ? e.setData({
                    isShowStreet: !1
                }) : (a.data.street_id && i.data.forEach(function(t) {
                    t.id == a.data.street_id && a.setData({
                        "form.street": t.areaname
                    });
                }), !s._isTextEmpty(i.data) && i.data.length > 0 ? e.setData({
                    districtVal: i.data,
                    isShowStreet: !0
                }) : e.setData({
                    isShowStreet: !1
                }));
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    _getProvinceData: function() {
        var t = this;
        wx.getStorage({
            key: "provinceData",
            success: function(a) {
                t.setData({
                    provinceData: a.data
                }), t.setData({
                    "selectAddressData[0].name": a.data[t.data.pickerValue[0]].areaname,
                    "selectAddressData[0].id": a.data[t.data.pickerValue[0]].id,
                    "selectAddressData[0].index": t.data.pickerValue[0]
                }), t._getCityData();
            }
        });
    },
    _getCityData: function() {
        var t = this.data.selectAddressData[0], a = this;
        wx.getStorage({
            key: "cityData",
            success: function(e) {
                for (var i = [], r = 0; r < e.data.length; r++) e.data[r].parentid == t.id && i.push(e.data[r]);
                a.setData({
                    cityData: i
                }), a.setData({
                    "selectAddressData[1].name": i[a.data.pickerValue[1]].areaname,
                    "selectAddressData[1].id": i[a.data.pickerValue[1]].id,
                    "selectAddressData[1].index": a.data.pickerValue[1]
                }), a._getDistrictData();
            }
        });
    },
    _getDistrictData: function() {
        var t = this.data.selectAddressData[1], a = this;
        wx.getStorage({
            key: "districtData",
            success: function(e) {
                for (var i = [], r = 0; r < e.data.length; r++) e.data[r].parentid == t.id && i.push(e.data[r]);
                a.setData({
                    districtData: i
                }), a.setData({
                    "selectAddressData[2].name": i[a.data.pickerValue[2]].areaname,
                    "selectAddressData[2].id": i[a.data.pickerValue[2]].id,
                    "selectAddressData[2].index": a.data.pickerValue[2]
                });
            }
        });
    },
    getIsOpenAddress: function() {
        var t = this, a = s.getNetAddresss("member.member-address.is-region");
        s._getNetWork({
            url: a,
            success: function(a) {
                var e = a.data;
                1 != e.result || s._isTextEmpty(e.data) ? console.log(e.msg) : t.setData({
                    is_region: e.data.is_region
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    streetClose: function(t) {
        this.setData({
            streetShow: !1,
            opren: !0
        });
    },
    streetConfirm: function(t) {
        var a = t.target.dataset.strname, e = t.target.dataset.id;
        this.setData({
            street_id: e,
            "form.street": a,
            streetShow: !1
        });
    },
    handle: function() {
        "office" != this.data.type && "officedetail" != this.data.type || this.submitOffice(), 
        "lawyer" != this.data.type && "lawyerdetail" != this.data.type || this.submitLawyer();
    },
    submitLawyer: function() {
        var t = this, a = {
            name: "请输入姓名",
            logo_img: "请上传头像",
            gender: "请选择性别",
            mobile: "请输入手机号",
            office: "请选择所属律所",
            domainColumn: "请选择擅长领域",
            job_year: "请输入执业年限",
            job_name: "请输入职称",
            job_no: "请输入执业证号",
            Practice_img: "请上传执业证照片",
            job_time: "请选择执业起始时间",
            desc: "请输入简介",
            addressName: "请选择服务区域",
            locationTitle: "请选择地理位置"
        };
        for (var e in a) if ("" == this.data.form[e]) return s.tips(a[e]);
        if (!this.data.agremment && "lawyer" == this.data.type && 1 == this.data.l_status) return s.tips("请勾选阅读并同意协议");
        var i = [];
        this.data.domainColumn.forEach(function(t) {
            t.status && i.push(t.id);
        });
        var r = this.data.form.job_time.replace(/-/g, ",");
        r = new Date(r).getTime() / 1e3;
        var n = {
            name: this.data.form.name,
            avatar: this.data.form.logo_img,
            gender: "男" == this.data.form.gender ? 1 : 2,
            tel: this.data.form.mobile,
            lf_id: this.data.radio || this.data.lf_id,
            category_ids: i,
            year: this.data.form.job_year,
            title: this.data.form.job_name,
            number: this.data.form.job_no,
            number_thumb: this.data.form.Practice_img,
            id_card_front_thumb: this.data.form.identity_card_front_img,
            id_card_back_thumb: this.data.form.identity_card_backend_img,
            start_time: r,
            introduction: this.data.form.desc,
            address: {
                area: this.data.district_id,
                city: this.data.city_id,
                province: this.data.province_id
            },
            location: [ this.data.form.point.lng, this.data.form.point.lat ],
            location_name: this.data.form.locationTitle
        }, o = "lawyer" == this.data.type ? "plugin.lawyer-platform.frontend.controllers.lawyer.apply" : "plugin.lawyer-platform.frontend.controllers.lawyer.edit", d = {
            form: n
        };
        "lawyerdetail" == this.data.type && (d.id = this.data.lawyerId), "lawyer" == this.data.share && (d.form.merchant_member_id = this.data.merchant_member_id);
        var c = s.getNetAddresss(o);
        s._postNetWork({
            url: c,
            data: d,
            success: function(a) {
                1 == a.data.result ? (s.tips(a.data.msg), "lawyer" == t.data.type || "lawyerdetail" == t.data.type ? wx.navigateBack() : wx.navigateTo({
                    url: "/packageI/lawyerPlatform/lawyerPlatform_index/index"
                })) : s.tips(a.data.msg);
            }
        });
    },
    cancelOffice: function() {
        this.setData({
            officeShow: !1
        });
    },
    submitOffice: function() {
        var t = this, a = {
            name: "请输入律所名称",
            logo_img: "请上传logo",
            mobile: "请输入联系电话",
            desc: "请输入简介",
            Practice_img: "请上传资质",
            addressName: "请选择律所所在地址",
            detailed_address: "请输入详细地址",
            status: "请选择状态"
        }, e = {
            name: this.data.form.name,
            logo: this.data.form.logo_img,
            tel: this.data.form.mobile,
            thumb: this.data.form.Practice_img,
            introduction: this.data.form.desc,
            address: {
                area: this.data.district_id,
                city: this.data.city_id,
                province: this.data.province_id
            },
            address_detail: this.data.form.detailed_address,
            status: this.data.status
        };
        for (var i in this.data.isShowStreet && (a.stree = "请选择街道", e.address.street = this.data.street_id), 
        a) if ("" == this.data.form[i]) return s.tips(a[i]);
        if (!this.data.agremment && "office" == this.data.type && 1 == this.data.l_status) return s.tips("请勾选阅读并同意协议");
        var r = {
            form: e
        };
        "officedetail" == this.data.type && (r.id = this.data.officeId), "office" == this.data.type && (r.form.merchant_member_id = this.data.merchant_member_id, 
        this.data.enterprise_radio && (r.form.business_id = this.data.enterprise_radio));
        var n = "office" == this.data.type ? "plugin.lawyer-platform.frontend.controllers.lawyer-firm.apply" : "plugin.lawyer-platform.frontend.controllers.lawyer-firm.edit", o = s.getNetAddresss(n);
        s._postNetWork({
            url: o,
            data: r,
            success: function(a) {
                1 == a.data.result ? (s.tips(a.data.msg), "officedetail" == t.data.type || "office" == t.data.type ? wx.navigateBack() : wx.navigateTo({
                    url: "/packageI/lawyerPlatform/lawyerPlatform_index/index"
                })) : s.tips(a.data.msg);
            }
        });
    },
    confirmOffice: function() {
        var t = this, a = this.data.columnsOffice.filter(function(a) {
            return a.id == t.data.radio;
        });
        this.setData({
            officeShow: !1,
            "form.office": a[0].name
        });
    },
    bindscrolltolower: function() {
        var t = this;
        if (this.data.current_page >= this.data.last_page) return !1;
        var a = this.data.current_page + 1;
        s._getNetWork({
            url: s.getNetAddresss("plugin.lawyer-platform.frontend.controllers.lawyer.getLawyerFirm"),
            data: {
                page: a
            },
            success: function(a) {
                1 == a.data.result && (t.data.columnsOffice = t.data.columnsOffice.concat(a.data.data.list.data), 
                t.setData({
                    columnsOffice: t.data.columnsOffice,
                    current_page: a.data.data.list.current_page,
                    last_page: a.data.data.list.last_page
                }));
            }
        });
    },
    bindscrolltolowerEnterprise: function() {
        var t = this;
        if (this.data.current_page_enterprise >= this.data.last_page_enterprise) return !1;
        var a = this.data.current_page_enterprise + 1;
        s._getNetWork({
            url: s.getNetAddresss("plugin.lawyer-platform.frontend.controllers.lawyer-firm.verify"),
            data: {
                page: a
            },
            success: function(a) {
                1 == a.data.result && (t.data.enterpriseList = t.data.enterpriseList.concat(a.data.data.business_list.data), 
                t.setData({
                    enterpriseList: t.data.enterpriseList,
                    current_page_enterprise: a.data.data.business_list.current_page,
                    last_page_enterprise: a.data.data.business_list.last_page
                }));
            }
        });
    },
    chooseOffice: function(t) {
        this.setData({
            radio: t.currentTarget.dataset.id,
            lf_id: t.currentTarget.dataset.id
        });
    },
    handleInput: function(t) {
        var a = t.detail, e = t.target.dataset.filed, i = "form.".concat(e);
        "mobile" != e || "lawyer" != this.data.type && "lawyerdetail" != this.data.type || (a = a.replace(/[^0-9]/g, "")), 
        this.setData(r({}, i, a));
    },
    openPop: function(t) {
        var a = this, e = t.target;
        if ("enterpriseShow" == e.dataset.filed && this.data.enterprise_radio) {
            var i = this.data.enterpriseList.filter(function(t) {
                return t.name == a.data.enterprise_name;
            });
            this.setData({
                enterprise_radio: i[0].id
            });
        }
        this.setData(r({}, e.dataset.filed, !0));
    },
    popConfirm: function(t) {
        var a = t.detail, e = t.target, i = e.dataset.filed;
        if ("job_time" == i) {
            var s = new Date(a), n = s.getFullYear(), o = s.getMonth() + 1, d = s.getDate();
            o < 10 && (o = "0".concat(o)), d < 10 && (d = "0".concat(d)), this.setData({
                "form.job_time": "".concat(n, "-").concat(o, "-").concat(d)
            });
        } else if ("domainColumn" == i) {
            var c = this.data.domainColumn.filter(function(t) {
                return 1 == t.status;
            });
            this.setData({
                "form.domainColumn": c
            });
        } else this.setData(r({}, "form.".concat(i), a.value));
        this.setData(r({}, e.dataset.flag, !1));
    },
    closePop: function(t) {
        var a = t.target;
        "domainShow" == a.dataset.flag && (this.data.domainColumn.forEach(function(t) {
            return t.status = !1;
        }), this.setData({
            domainColumn: this.data.domainColumn
        })), this.setData(r({}, a.dataset.flag, !1));
    },
    onReady: function() {},
    onShow: (t = e(a.default.mark(function t() {
        var e, i, r, s;
        return a.default.wrap(function(t) {
            for (;;) switch (t.prev = t.next) {
              case 0:
                if (e = getCurrentPages(), i = e[e.length - 1], (r = i.options).type && this.setData({
                    type: r.type,
                    share: r.share || "",
                    merchant_member_id: r.merchant_member_id || ""
                }), "officedetail" != r.type && "lawyerdetail" != r.type || this.setData({
                    show_page: !0
                }), "lawyer" != r.share && "office" != r.share && "office" != r.type && "lawyer" != r.type) {
                    t.next = 8;
                    break;
                }
                return t.next = 8, this.checkLawyer();

              case 8:
                this.getCtegory(), this.getLawyerOffice(), this._initAddressInfo(), this.getIsOpenAddress(), 
                "office" != r.type && "lawyer" != r.type || ("office" == r.type && this.getEnterprise(), 
                this._getData()), "officedetail" == r.type && this._getDeatil(), "lawyerdetail" == r.type && this._getLawyerDeatil(), 
                s = wx.getStorageSync("applyaddresspoint"), this.setData({
                    "form.locationTitle": s.address,
                    "form.point": s.point
                });

              case 17:
              case "end":
                return t.stop();
            }
        }, t, this);
    })), function() {
        return t.apply(this, arguments);
    }),
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});